﻿<Window
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:NewsFeedSample="clr-namespace:NewsFeedSample"
    xmlns:Facebook="clr-namespace:Facebook.BindingHelper;assembly=Facebook"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" x:Class="NewsFeedSample.MainWindow"
    Title="Facebook Newsfeed Sample" Height="600" Width="800" mc:Ignorable="d">
    <Window.Resources>
        <NewsFeedSample:DateTimeToStringConverter x:Key="DateTimeConverter" />
        <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        <NewsFeedSample:MultiValueAggregator x:Key="MultiAggregator" />
		<NewsFeedSample:ShouldShowCommentBoxConverter x:Key="ShouldShowCommentBoxConverter"/>

        <ItemsPanelTemplate x:Key="VirtualizedItemsPanelTemplate">
            <VirtualizingStackPanel />
        </ItemsPanelTemplate>

        <!-- Background for the control -->
        <LinearGradientBrush x:Key="Background_ChromeDefault" StartPoint="0,0" EndPoint="0,1">
            <GradientStop Color="#FF18B2E8" Offset="0"/>
            <GradientStop Color="#FF7DF5D9" Offset="1"/>
            <GradientStop Color="#FF18B2E8" Offset="0.5"/>
        </LinearGradientBrush>

        <!-- Chromeless button style -->
        <Style x:Key="SimpleButtonStyle"
           TargetType="{x:Type Button}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type Button}">
                        <ContentPresenter />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <Trigger Property="IsEnabled" Value="True">
                    <Setter Property="Cursor" Value="Hand" />
                </Trigger>
            </Style.Triggers>
        </Style>

        <!-- Image Thumbnail Template -->
        <Style TargetType="{x:Type NewsFeedSample:ImageThumbnailControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type NewsFeedSample:ImageThumbnailControl}">
                        <Viewbox Stretch="UniformToFill"
                             DataContext="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}"
                             Height="{TemplateBinding Height}"
                             Width="{TemplateBinding Width}">
                            <Viewbox.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1"
                                                ScaleY="1" />
                                </TransformGroup>
                            </Viewbox.RenderTransform>
                            <Image Source="{Binding Path=ImageSource}"
                               x:Name="ThumbnailTransform" />
                        </Viewbox>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=ImageSource, RelativeSource={RelativeSource Self}}"
                         Value="{x:Null}">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="0"
                                             Duration="0" />
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="1"
                                             Duration="00:00:00.15"
                                             AccelerationRatio="0.4"
                                             DecelerationRatio="0.2" />
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                      Value="0.5"
                                                      KeySpline="0,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
                                                      Value="1.25"
                                                      KeySpline="0.125,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
                                                      Value="1.0" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                      Value="0.5"
                                                      KeySpline="0,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
                                                      Value="1.25"
                                                      KeySpline="0.125,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
                                                      Value="1.0" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <!-- Large Image Thumbnail Template -->
        <Style TargetType="{x:Type NewsFeedSample:LargeImageThumbnailControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type NewsFeedSample:LargeImageThumbnailControl}">
                        <Viewbox Stretch="UniformToFill"
                             DataContext="{Binding Path=., RelativeSource={RelativeSource TemplatedParent}}"
                             Height="{TemplateBinding Height}"
                             Width="{TemplateBinding Width}">
                            <Viewbox.RenderTransform>
                                <TransformGroup>
                                    <ScaleTransform ScaleX="1"
                                                ScaleY="1" />
                                </TransformGroup>
                            </Viewbox.RenderTransform>
                            <Image Source="{Binding Path=ImageSource}"
                               x:Name="ThumbnailTransform" />
                        </Viewbox>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=ImageSource, RelativeSource={RelativeSource Self}}"
                         Value="{x:Null}">
                    <DataTrigger.EnterActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="0"
                                             Duration="0" />
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.EnterActions>
                    <DataTrigger.ExitActions>
                        <BeginStoryboard>
                            <Storyboard>
                                <DoubleAnimation Storyboard.TargetProperty="Opacity"
                                             To="1"
                                             Duration="00:00:00.15"
                                             AccelerationRatio="0.4"
                                             DecelerationRatio="0.2" />
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                      Value="0.5"
                                                      KeySpline="0,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
                                                      Value="1.25"
                                                      KeySpline="0.125,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
                                                      Value="1.0" />
                                </DoubleAnimationUsingKeyFrames>
                                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00"
                                                           Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
                                    <SplineDoubleKeyFrame KeyTime="00:00:00"
                                                      Value="0.5"
                                                      KeySpline="0,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1000000"
                                                      Value="1.25"
                                                      KeySpline="0.125,0,0.875,1" />
                                    <SplineDoubleKeyFrame KeyTime="00:00:00.1500000"
                                                      Value="1.0" />
                                </DoubleAnimationUsingKeyFrames>
                            </Storyboard>
                        </BeginStoryboard>
                    </DataTrigger.ExitActions>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <FontFamily x:Key="SerifFont">./../../Fonts/#Pescadero</FontFamily>
        <FontFamily x:Key="SansSerifFont">./../../Fonts/#Miramonte</FontFamily>

        <SolidColorBrush x:Key="DarkTextBrush"
                     Color="#FF000000" />

        <SolidColorBrush x:Key="MediumTextBrush"
                     Color="#FFE8ECED" />

        <SolidColorBrush x:Key="LightTextBrush"
                     Color="#FFFFFFFF" />

        <Style x:Key="ShareStackPanelStyle" TargetType="{x:Type StackPanel}">
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="HorizontalAlignment" Value="Left" />
            <Setter Property="Orientation" Value="Horizontal" />
        </Style>

        <LinearGradientBrush x:Key="ShareTextBoxLightBackgroundBrush"
                         EndPoint="0.5,1"
                         StartPoint="0.5,0">
            <GradientStop Color="#FF6A6F71"
                      Offset="0.014" />
            <GradientStop Color="#FF7F8589"
                      Offset="0.027" />
            <GradientStop Color="#FF7F8589"
                      Offset="0.055" />
            <GradientStop Color="#FF9FA7AB"
                      Offset="0.068" />
            <GradientStop Color="#FF9FA7AB"
                      Offset="0.096" />
            <GradientStop Color="#FFB5BEC3"
                      Offset="0.11" />
            <GradientStop Color="#FFBFC8CD"
                      Offset="0.151" />
        </LinearGradientBrush>

        <LinearGradientBrush x:Key="ShareTextBoxDarkBackgroundBrush"
                         EndPoint="0.5,1"
                         StartPoint="0.5,0">
            <GradientStop Color="#FF1E1F22"
                      Offset="0.023" />
            <GradientStop Color="#FF2B2C31"
                      Offset="0.031" />
            <GradientStop Color="#FF393B41"
                      Offset="0.125" />
        </LinearGradientBrush>

        <ControlTemplate x:Key="ShareTextBoxTemplate"
                     TargetType="{x:Type TextBox}">
            <Border BorderBrush="{TemplateBinding BorderBrush}"
                BorderThickness="{TemplateBinding BorderThickness}"
                CornerRadius="4,0,0,4"
                Background="{TemplateBinding Background}">
                <Grid>
                    <TextBlock Text="{TemplateBinding Tag}"
                           Foreground="{DynamicResource LightTextBrush}"
                           FontFamily="{TemplateBinding FontFamily}"
                           FontSize="{TemplateBinding FontSize}"
                           IsHitTestVisible="False"
                           VerticalAlignment="Center"
                           Margin="2,0,0,0"
                           Visibility="Hidden"
                           Opacity="0.7"
                           x:Name="Watermark" />
                    <ScrollViewer x:Name="PART_ContentHost"
                              Margin="2,0,2,0"
                              VerticalAlignment="Center"
                              SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <MultiTrigger>
                    <MultiTrigger.Conditions>
                        <Condition Property="IsFocused"
                               Value="False" />
                        <Condition Property="Text"
                               Value="" />
                    </MultiTrigger.Conditions>

                    <Setter TargetName="Watermark"
                        Property="Visibility"
                        Value="Visible" />
                </MultiTrigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="ShareTextBoxDarkStyle"
           TargetType="{x:Type TextBox}">
            <Setter Property="Template"
                Value="{StaticResource ShareTextBoxTemplate}" />
            <Setter Property="BorderBrush"
                Value="{DynamicResource DarkTextBrush}" />
            <Setter Property="BorderThickness"
                Value="1,1,1,1" />
            <Setter Property="Background"
                Value="{DynamicResource ShareTextBoxDarkBackgroundBrush}" />
            <Setter Property="FontFamily"
                Value="{DynamicResource SerifFont}" />
            <Setter Property="FontSize"
                Value="{DynamicResource FontSize}" />
            <Setter Property="Foreground"
                Value="{DynamicResource LightTextBrush}" />
            <Setter Property="HorizontalAlignment"
                Value="Left" />
            <Setter Property="SpellCheck.IsEnabled"
                Value="True" />
        </Style>

        <Style x:Key="ShareTextBoxLightStyle"
           TargetType="{x:Type TextBox}"
           BasedOn="{StaticResource ShareTextBoxDarkStyle}">
            <Setter Property="BorderThickness"
                Value="1,0,1,1" />
            <Setter Property="Background"
                Value="{DynamicResource ShareTextBoxLightBackgroundBrush}" />
            <Setter Property="BorderBrush"
                Value="#FF696F71" />
            <Setter Property="FontFamily"
                Value="{DynamicResource SansSerifFont}" />
            <Setter Property="SpellCheck.IsEnabled"
                Value="True" />
        </Style>

        <ControlTemplate x:Key="ShareButtonTemplate"
                     TargetType="{x:Type Button}">
            <Border BorderThickness="{TemplateBinding BorderThickness}"
                CornerRadius="0,4,4,0"
                BorderBrush="{TemplateBinding BorderBrush}"
                Background="{TemplateBinding Background}"
                x:Name="Host">
                <Grid>
                    <TextBlock Text="{TemplateBinding Content}"
                           VerticalAlignment="Center"
                           Margin="2,0,2,0"
                           HorizontalAlignment="Center"
                           Foreground="White"
                           FontFamily="{TemplateBinding FontFamily}"
                           FontSize="{TemplateBinding FontSize}"
                           Opacity="0"
                           x:Name="Glow">
                    <TextBlock.Effect>
                        <BlurEffect />
                    </TextBlock.Effect>
                    </TextBlock>

                    <TextBlock Text="{TemplateBinding Content}"
                           VerticalAlignment="Center"
                           Margin="2,0,2,0"
                           HorizontalAlignment="Center"
                           Foreground="{TemplateBinding Foreground}"
                           FontFamily="{TemplateBinding FontFamily}"
                           FontSize="{TemplateBinding FontSize}"
                           x:Name="Main" />
                </Grid>
            </Border>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver"
                     Value="True">
                    <Setter TargetName="Glow"
                        Property="Opacity"
                        Value="1" />
                </Trigger>
                <Trigger Property="IsPressed"
                     Value="True">
                    <Setter TargetName="Main"
                        Property="Opacity"
                        Value="0.7" />
                </Trigger>
                <Trigger Property="IsEnabled"
                     Value="False">
                    <Setter TargetName="Host"
                        Property="Opacity"
                        Value="0.4" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="ShareButtonDarkStyle"
           TargetType="{x:Type Button}">
            <Setter Property="Template"
                Value="{StaticResource ShareButtonTemplate}" />
            <Setter Property="BorderThickness"
                Value="0,1,1,1" />
            <Setter Property="BorderBrush"
                Value="{DynamicResource DarkTextBrush}" />
            <Setter Property="Background"
                Value="{DynamicResource ShareTextBoxDarkBackgroundBrush}" />
            <Setter Property="Cursor"
                Value="Hand" />
            <Setter Property="Width"
                Value="55" />
            <Setter Property="Foreground"
                Value="{DynamicResource LightTextBrush}" />
            <Setter Property="FontFamily"
                Value="{DynamicResource SansSerifFont}" />
        </Style>

        <Style x:Key="ShareButtonLightStyle"
           TargetType="{x:Type Button}"
           BasedOn="{StaticResource ShareButtonDarkStyle}">
            <Setter Property="Template"
                Value="{StaticResource ShareButtonTemplate}" />
            <Setter Property="BorderThickness"
                Value="0,0,1,1" />
            <Setter Property="Background"
                Value="{DynamicResource ShareTextBoxLightBackgroundBrush}" />
        </Style>

        <ControlTemplate x:Key="CommentButtonTemplate"
                     TargetType="{x:Type ToggleButton}">
            <Grid Background="#00000000"
              Cursor="Hand"
              x:Name="Host">
                <ContentPresenter x:Name="Glow"
                              TextBlock.FontSize="{TemplateBinding FontSize}"
                              TextBlock.FontWeight="{TemplateBinding FontWeight}"
                              TextBlock.Foreground="White"
                              Opacity="0"
                              Margin="4">
                    <ContentPresenter.Effect>
                        <BlurEffect />
                    </ContentPresenter.Effect>
                </ContentPresenter>
                <ContentPresenter x:Name="Presenter"
                              TextBlock.FontSize="{TemplateBinding FontSize}"
                              TextBlock.FontWeight="{TemplateBinding FontWeight}"
                              TextBlock.Foreground="{TemplateBinding Foreground}"
                              Margin="4" />
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="0" />
                    <Setter Property="Opacity" TargetName="Presenter" Value="0.7" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="1" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="Host" Value="0.5" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="CommentButtonStyle"
           TargetType="{x:Type ButtonBase}">
            <Setter Property="Template" Value="{DynamicResource CommentButtonTemplate}" />
            <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
            <Setter Property="FontSize" Value="16" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontWeight" Value="Bold" />
        </Style>

        <ControlTemplate x:Key="ShowMoreCommentsButtonTemplate" TargetType="{x:Type ToggleButton}">
            <Grid Background="#00000000" Cursor="Hand" x:Name="Host">
                <ContentPresenter x:Name="Glow"
          TextBlock.FontSize="{TemplateBinding FontSize}"
          TextBlock.FontWeight="{TemplateBinding FontWeight}"
          TextBlock.Foreground="White"
          Opacity="0"
          Margin="4">
                    <ContentPresenter.Effect>
                        <BlurEffect />
                    </ContentPresenter.Effect>
                </ContentPresenter>
                <ContentPresenter x:Name="Presenter"
          TextBlock.FontSize="{TemplateBinding FontSize}"
          TextBlock.FontWeight="{TemplateBinding FontWeight}"
          TextBlock.Foreground="{TemplateBinding Foreground}"
          Margin="4" />
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsChecked" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="0" />
                    <Setter Property="Opacity" TargetName="Presenter"  Value="0.7" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="1" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Visibility" TargetName="Host" Value="Collapsed" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>
        
        <Style x:Key="ShowMoreCommentsButtonStyle" TargetType="{x:Type ButtonBase}">
            <Setter Property="Template" Value="{DynamicResource CommentButtonTemplate}" />
            <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
            <Setter Property="FontSize" Value="16" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontWeight" Value="Bold" />
        </Style>

        <Style x:Key="ActorNameTextStyle" TargetType="{x:Type Hyperlink}">
            <Setter Property="Foreground" Value="Navy"/>
            <Setter Property="TextDecorations" Value="None"/>
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="TextDecorations" Value="Underline"/>
                </Trigger>
                <Trigger Property="IsEnabled" Value="True">
                    <Setter Property="Cursor" Value="Hand"/>
                </Trigger>
            </Style.Triggers>
        </Style>

        <ControlTemplate x:Key="RemoveCommentButtonTemplate"
                     TargetType="{x:Type Button}">
            <Grid Background="#00000000"
              Cursor="Hand"
              x:Name="Host">
                <ContentPresenter x:Name="Glow"
                              TextBlock.FontSize="{TemplateBinding FontSize}"
                              TextBlock.FontWeight="{TemplateBinding FontWeight}"
                              TextBlock.Foreground="White"
                              Opacity="0">
                    <ContentPresenter.Effect>
                        <BlurEffect />
                    </ContentPresenter.Effect>
                </ContentPresenter>
                <ContentPresenter x:Name="Presenter"
                              TextBlock.FontSize="{TemplateBinding FontSize}"
                              TextBlock.FontWeight="{TemplateBinding FontWeight}"
                              TextBlock.Foreground="{TemplateBinding Foreground}" />
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="0" />
                    <Setter Property="Opacity" TargetName="Presenter" Value="0.7" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="1" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="Host" Value="0.5" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="RemoveCommentButtonStyle"
           TargetType="{x:Type ButtonBase}" BasedOn="{StaticResource CommentButtonStyle}">
            <Setter Property="Template" Value="{DynamicResource RemoveCommentButtonTemplate}" />
            <Setter Property="FontSize" Value="12" />
            <Setter Property="Margin" Value="10,0,0,0" />
        </Style>
        
        <ControlTemplate x:Key="CopyItemButtonTemplate"
                     TargetType="{x:Type Button}">
            <Grid Background="#00000000"
              Cursor="Hand"
              x:Name="Host">
                <ContentPresenter x:Name="Glow"
                              TextBlock.FontSize="{TemplateBinding FontSize}"
                              TextBlock.FontWeight="{TemplateBinding FontWeight}"
                              TextBlock.Foreground="White"
                              Opacity="0">
                    <ContentPresenter.Effect>
                        <BlurEffect />
                    </ContentPresenter.Effect>
                </ContentPresenter>
                <ContentPresenter x:Name="Presenter"
                              TextBlock.FontSize="{TemplateBinding FontSize}"
                              TextBlock.FontWeight="{TemplateBinding FontWeight}"
                              TextBlock.Foreground="{TemplateBinding Foreground}" />
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="0.5" />
                    <Setter Property="Opacity" TargetName="Presenter" Value="0.7" />
                </Trigger>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="1" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="Host" Value="0.5" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="CopyItemButtonStyle" TargetType="{x:Type ButtonBase}" BasedOn="{StaticResource CommentButtonStyle}">
            <Setter Property="Template" Value="{DynamicResource CopyItemButtonTemplate}" />
            <Setter Property="FontSize" Value="12" />
            <Setter Property="Margin" Value="10,0,0,0" />
        </Style>

        <Style x:Key="LikePathStyle" TargetType="{x:Type Path}">
            <Setter Property="Fill" Value="#FFFFFFFF" />
            <Setter Property="Width" Value="18" />
            <Setter Property="Height" Value="19" />
            <Setter Property="Margin" Value="4" />
            <Setter Property="Data"
                Value="F1M2,9C2.01200008392334,9 2.13299989700317,9 3,9 4.10400009155273,9 5,9 5,9 5,9 5,16 5,16 5,16.867000579834 5,16.988000869751 5,17 4.89499998092651,17 3,17 3,17 3,17 2,9 2,9z M12,2C13.1040000915527,2 13.5520000457764,4.04300022125244 13,5 13,5 11.2849998474121,8 11.2849998474121,8 11.2849998474121,8 15,8 15,8 16.6569995880127,8 17,9.3430004119873 17,11 17,11 16,15 16,15 16,16.6569995880127 13,18 13,18 13,18 8,17 8,17 6.34299993515015,17 6,15.6569995880127 6,14 6,14 6,11 6,11 6,10.6929998397827 6.05900001525879,10.4020004272461 6.14499998092651,10.1230001449585 6.08500003814697,9.89900016784668 6.04899978637695,9.55099964141846 6.04899978637695,9 6.04899978637695,9 10.423999786377,4.06300020217896 10.423999786377,4.06300020217896 10.9759998321533,3.10599994659424 11,2 12,2z" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
        </Style>

        <ControlTemplate x:Key="LikeButtonTemplate" TargetType="{x:Type Button}">
            <Grid Cursor="Hand" x:Name="Host">
                <Path x:Name="Glow"
                  Style="{StaticResource LikePathStyle}"
                  Fill="White"
                  Opacity="0">
                    <Path.Effect>
                        <BlurEffect Radius="5" />
                    </Path.Effect>
                </Path>
                <Path x:Name="Like" Style="{StaticResource LikePathStyle}"/>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="1" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Opacity" TargetName="Like" Value="0.7" />
                    <Setter Property="Opacity" TargetName="Glow" Value="0" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="Host" Value="0.5" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="LikeButtonStyle" TargetType="{x:Type Button}">
            <Setter Property="Template" Value="{DynamicResource LikeButtonTemplate}" />
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="Margin" Value="10,0,0,2" />
        </Style>

        <Style x:Key="SeparationBorderStyle" TargetType="{x:Type Border}">
            <Setter Property="Height" Value="2" />
            <Setter Property="BorderBrush" Value="#FFD5DADF" />
            <Setter Property="BorderThickness" Value="0,0,0,1" />
            <Setter Property="Background" Value="#FF7F8A94" />
        </Style>

        <Style x:Key="CrossPathStyle" TargetType="{x:Type Path}">
            <Setter Property="Fill" Value="#FFAC0000" />
            <Setter Property="Stretch" Value="Fill" />
            <Setter Property="HorizontalAlignment" Value="Center" />
            <Setter Property="VerticalAlignment" Value="Center" />
            <Setter Property="Margin" Value="0,3,0,0" />
            <Setter Property="Width" Value="16.625" />
            <Setter Property="Height" Value="16.625" />
            <Setter Property="RenderTransformOrigin" Value="0.5,0.5" />
            <Setter Property="Data"
        Value="M7.25,0 L9.375,0 9.375,7.2500001 16.625,7.2500001 16.625,9.375 9.375,9.375 9.375,16.625 7.25,16.625 7.25,9.375 0,9.375 0,7.2500001 7.25,7.2500001 z" />
        </Style>

        <ControlTemplate x:Key="RemoveLikeButtonTemplate" TargetType="{x:Type Button}">
            <Grid x:Name="Host" Cursor="Hand">
                <Path x:Name="Like" Style="{StaticResource LikePathStyle}" />
                <Path x:Name="Glow" Style="{StaticResource CrossPathStyle}" Fill="Red" Opacity="0">
                    <Path.Effect>
                        <BlurEffect Radius="6" />
                    </Path.Effect>
                    <Path.RenderTransform>
                        <RotateTransform Angle="-45" />
                    </Path.RenderTransform>
                </Path>
                <Path x:Name="Cross" Style="{StaticResource CrossPathStyle}">
                    <Path.RenderTransform>
                        <RotateTransform Angle="-45" />
                    </Path.RenderTransform>
                </Path>
            </Grid>
            <ControlTemplate.Triggers>
                <Trigger Property="IsMouseOver" Value="True">
                    <Setter Property="Opacity" TargetName="Glow" Value="1" />
                </Trigger>
                <Trigger Property="IsPressed" Value="True">
                    <Setter Property="Opacity" TargetName="Like" Value="0.7" />
                    <Setter Property="Opacity" TargetName="Cross" Value="0.7" />
                    <Setter Property="Opacity" TargetName="Glow" Value="0" />
                </Trigger>
                <Trigger Property="IsEnabled" Value="False">
                    <Setter Property="Opacity" TargetName="Host" Value="0.5" />
                </Trigger>
            </ControlTemplate.Triggers>
        </ControlTemplate>

        <Style x:Key="RemoveLikeButtonStyle" TargetType="{x:Type Button}" BasedOn="{StaticResource LikeButtonStyle}">
            <Setter Property="Template" Value="{DynamicResource RemoveLikeButtonTemplate}" />
        </Style>

        <Style TargetType="{x:Type Border}" x:Key="LargeThumbnailBorderStyle">
            <Setter Property="Width" Value="97" />
            <Setter Property="Height" Value="97" />
            <Setter Property="Background" Value="White" />
            <Setter Property="BorderBrush" Value="Black" />
            <Setter Property="BorderThickness" Value="1" />
            <Setter Property="Padding" Value="1" />
            <Setter Property="CornerRadius" Value="8" />
            <Setter Property="Margin" Value="49,0,20,0" />
            <Setter Property="VerticalAlignment" Value="Top" />
        </Style>

        <Style TargetType="{x:Type Border}" x:Key="ThumbnailBorderStyle" BasedOn="{StaticResource LargeThumbnailBorderStyle}">
            <Setter Property="Width" Value="49" />
            <Setter Property="Height" Value="50" />
            <Setter Property="CornerRadius" Value="6" />
        </Style>

        <Style x:Key="AttachmentTextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="FontSize" Value="20" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="TextWrapping" Value="Wrap" />
            <Setter Property="Visibility" Value="Visible"/>
            <Setter Property="Margin" Value="0,5,0,0"/>
            <Style.Triggers>
                <DataTrigger Binding="{Binding Path=Text}" Value="">
                    <Setter Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </Style.Triggers>
        </Style>

        <Style x:Key="MessageTextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="FontFamily" Value="{DynamicResource SerifFont}" />
            <Setter Property="FontSize" Value="18" />
        </Style>

        <Style x:Key="CreatedTextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
            <Setter Property="Foreground" Value="Black" />
            <Setter Property="FontSize" Value="12" />
            <Setter Property="IsHyphenationEnabled" Value="True" />
            <Setter Property="Margin" Value="0,0,0,6" />
        </Style>

        <Style x:Key="LikesTextBlockStyle" TargetType="{x:Type TextBlock}">
            <Setter Property="VerticalAlignment" Value="Bottom" />
            <Setter Property="FontFamily" Value="{DynamicResource SansSerifFont}" />
            <Setter Property="Foreground" Value="White" />
            <Setter Property="FontWeight" Value="Bold" />
            <Setter Property="FontSize" Value="12" />
            <Setter Property="Margin" Value="10,0,0,6" />
        </Style>

        <DataTemplate DataType="{x:Type Facebook:ActivityPostAttachment}">
            <StackPanel Orientation="Vertical">
                <ItemsControl HorizontalAlignment="Left"
                          ItemsSource="{Binding Path=Media}"
                          Margin="0,0,0,5"
                          x:Name="PhotoItemControl">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel />
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                    <ItemsControl.ItemTemplate>
                        <DataTemplate>
                            <Border Height="100"
                                Width="100"
                                Style="{StaticResource ThumbnailBorderStyle}">
                                <Button Style="{StaticResource SimpleButtonStyle}" x:Name="ImageButton">
                                    <NewsFeedSample:LargeImageThumbnailControl FacebookImage="{Binding Path=Photo.Photo.Image}" />
                                </Button>
                            </Border>
                        </DataTemplate>
                    </ItemsControl.ItemTemplate>
                </ItemsControl>
                <TextBlock Text="{Binding Path=Name}"
                       Style="{StaticResource AttachmentTextBlockStyle}" />
                <TextBlock Text="{Binding Path=Caption}" />
            </StackPanel>
            <DataTemplate.Triggers>
                <!--Collapse the collection of photos unless the Attachment is a photo album (in which case Media.Count should be >1)-->
                <DataTrigger Binding="{Binding Path=Media.Count}" Value="1">
                    <Setter TargetName="PhotoItemControl" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

        <DataTemplate x:Key="CommentTemplate" DataType="{x:Type Facebook:ActivityComment}">
            <Grid MinHeight="65" x:Name="CommentPanel">

                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <Button Style="{StaticResource SimpleButtonStyle}"
                    Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.NavigateToFriendCommand}}"
                    CommandParameter="{Binding Path=FromUser}">
                    <Border Width="49"
                        Height="50">
                        <Border.Style>
                            <Style TargetType="{x:Type Border}"
                               BasedOn="{StaticResource ThumbnailBorderStyle}">
                                <Setter Property="Margin"
                                    Value="0,0,20,0" />
                            </Style>
                        </Border.Style>

                        <Grid Background="{x:Null}">
                            <NewsFeedSample:LargeImageThumbnailControl FacebookImage="{Binding Path=FromUser.Image}"
                                                                Clip="M0,4 C0,1.790861 1.790861,0 4,0 L41,0 C43.209139,0 45,1.790861 45,4 L45,42 C45,44.209139 43.209139,46 41,46 L4,46 C1.790861,46 0,44.209139 0,42 z" />

                            <Path Fill="#33FFFFFF"
                              Stretch="Fill"
                              Margin="0,0,0,22.563"
                              Data="M0,4 C0,1.790861 1.790861,0 4,0 L41,0 C43.209139,0 45,1.790861 45,4 L45,12.353333 C45,12.353333 0,23.436667 0,23.436667 z" />
                        </Grid>
                    </Border>
                </Button>

                <StackPanel Grid.Column="1">

                    <TextBlock MaxWidth="550" TextWrapping="Wrap" FontSize="15">
                        <Hyperlink 
                          Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.NavigateToFriendCommand}}"
                          CommandParameter="{Binding Path=FromUser}"
                          FontWeight="Bold"
                          Style="{StaticResource ActorNameTextStyle}">
                            <InlineUIContainer>                      		
                                <TextBlock Text="{Binding Path=FromUser.Name}"/>                      	
                            </InlineUIContainer>
                        </Hyperlink>
                        <Run Text=" "/>
                        <InlineUIContainer>  
                    		<TextBlock>
                                <Run Text="at"/>
                            </TextBlock>
                    	</InlineUIContainer>
                        <Run Text=" "/>
                        <InlineUIContainer>
                    		<TextBlock Text="{Binding Path=Time, Converter={StaticResource DateTimeConverter}}"
                    			Style="{StaticResource CreatedTextBlockStyle}" />
                    	</InlineUIContainer>
                    </TextBlock>
                    <TextBlock TextWrapping="Wrap" FontSize="15"><NewsFeedSample:HyperlinkTextContent Text="{Binding Path=Text}" /><Run Text=" "/><InlineUIContainer>
                    		<Button x:Name="RemoveCommentButton"
                    			Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.RemoveCommentCommand}}"
                    			CommandParameter="{Binding}"
                    			Style="{StaticResource RemoveCommentButtonStyle}"
                    			Content="Remove"
                    			Visibility="Collapsed" />
                    	</InlineUIContainer></TextBlock>
                </StackPanel>

            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=IsPending}" Value="True">
                    <Setter TargetName="CommentPanel"
                        Property="TextElement.Foreground"
                        Value="Red" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=IsMine}" Value="True">
                    <Setter TargetName="RemoveCommentButton"
                        Property="Visibility"
                        Value="Visible" />
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

        <DataTemplate x:Key="NewsFeedItemTemplate"
                  DataType="{x:Type Facebook:ActivityPost}">
            <Grid Margin="5" Background="Transparent" MaxWidth="800">
                <Grid Margin="10,5">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>

                    <Button Style="{StaticResource SimpleButtonStyle}"
                    Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.NavigateToFriendCommand}}"
                    CommandParameter="{Binding Path=Actor}">
                        <Border Style="{StaticResource LargeThumbnailBorderStyle}">
                            <Border x:Name="ActivityBorder" BorderThickness="4" CornerRadius="6">
                                <Border.BorderBrush>
                                    <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                                        <GradientStop Color="Transparent" Offset="0.0"/>
                                        <GradientStop Color="Navy" Offset="1.0"/>
                                    </LinearGradientBrush>
                                </Border.BorderBrush>
                                <Grid Background="{x:Null}">
                                    <NewsFeedSample:LargeImageThumbnailControl FacebookImage="{Binding Path=Actor.Image}"
                                                                                 Clip="M0,6 C0,2.6862915 2.6862915,0 6,0 L87,0 C90.313708,0 93,2.6862915 93,6 L93,87 C93,90.313708 90.313708,93 87,93 L6,93 C2.6862915,93 0,90.313708 0,87 z" />
                                    <Path Fill="#33FFFFFF" Stretch="Fill"
                                          Data="M0,6 C0,2.6862915 2.6862915,0 6,0 L87,0 C90.313708,0 93,2.6862915 93,6 L93,25.29 C93,25.29 0,47.04 0,47.04 z"/>
                                </Grid>
                            </Border>
                        </Border>
                    </Button>

                    <StackPanel Grid.Column="1" Margin="10,10,0,0">
                        <TextBlock Style="{StaticResource MessageTextBlockStyle}" TextWrapping="Wrap">
                            <Hyperlink Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.NavigateToFriendCommand}}"
                                       CommandParameter="{Binding Path=Actor}"
                                       Style="{StaticResource ActorNameTextStyle}">
                                <NewsFeedSample:BindableRun Text="{Binding Path=Actor.Name}" FontWeight="Bold"/>
                            </Hyperlink>
                            <Run Text=" "/>
                            <InlineUIContainer>
                                <TextBlock x:Name="TargetBlock"><Run FontFamily="Webdings" Foreground="#215868" Text="4"/><Run Text=" "/><Hyperlink Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.NavigateToFriendCommand}}"
                        				CommandParameter="{Binding Path=Target}"><NewsFeedSample:BindableRun Text="{Binding Path=Target.Name}" FontWeight="Bold"/></Hyperlink><Run Text=" "/><Run Text=":"/></TextBlock>
                        	</InlineUIContainer>
                            <Run Text=" "/>
                            <NewsFeedSample:HyperlinkTextContent Text="{Binding Path=Message}" x:Name="MessageTextBox"/>
                        </TextBlock>

                        <!-- ContentPresenter to display status attachments.
                     DataTemplate for FacebookStreamAttachment is used to style this element-->
                        <ContentPresenter Content="{Binding Path=Attachment}" x:Name="AttachmentContentPresenter" />

                        <StackPanel Margin="5" Orientation="Horizontal">
                            <TextBlock Text="{Binding Path=CreatedTime, Converter={StaticResource DateTimeConverter}}"
                               Style="{StaticResource CreatedTextBlockStyle}" />

                            <TextBlock Text="{Binding Path=LikedCount, StringFormat=\{0\} like(s)}"
                               Style="{StaticResource LikesTextBlockStyle}" />

                            <Button x:Name="LikeButton"
                                    IsEnabled="{Binding Path=CanLike}"
                                    ToolTip="Like"
                                    Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.AddLikeCommand}}"
                                    CommandParameter="{Binding}">
                                <Button.Style>
                                    <Style TargetType="{x:Type Button}" BasedOn="{StaticResource LikeButtonStyle}">
                                        <Setter Property="Visibility" Value="Visible" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding Path=HasLiked}" Value="True">
                                                <Setter Property="Visibility" Value="Collapsed" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </Button.Style>
                            </Button>

                            <Button x:Name="RemoveLikeButton"
                                    Style="{DynamicResource RemoveLikeButtonStyle}"
                                    IsEnabled="{Binding Path=HasLiked}"
                                    Visibility="{Binding Path=HasLiked, Converter={StaticResource BooleanToVisibilityConverter}}"
                                    ToolTip="Unlike"
                                    Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.RemoveLikeCommand}}"
                                    CommandParameter="{Binding}" />

                            <!--<ToggleButton x:Name="MoreCommentsButton" 
                                          Style="{StaticResource ShowMoreCommentsButtonStyle}"
                                          Content="See More Comments"                  
                                          VerticalAlignment="Bottom"                  
                                          Margin="15, 0, 0, 0"                  
                                          Command="{Binding Source={x:Static ClientManager:ServiceProvider.ViewManager}, Path=NavigationCommands.GetMoreCommentsCommand}"                  
                                          CommandParameter="{Binding}"                  
                                          Visibility="{Binding HasMoreComments, Converter={StaticResource BooleanToVisibilityConverter}}" />-->
                            
                            <ToggleButton x:Name="CommentButton"
                                  Content="Comment"
                                  VerticalAlignment="Bottom"
                                  Margin="15,0,0,0"
                                  IsEnabled="{Binding Path=CanComment}">
                                <ToggleButton.Style>
                                    <Style TargetType="{x:Type ToggleButton}" BasedOn="{StaticResource CommentButtonStyle}">
                                        <Setter Property="Visibility" Value="Collapsed" />
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding Path=CanComment}" Value="True">
                                                <Setter Property="Visibility" Value="Visible" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </ToggleButton.Style>
                            </ToggleButton>
                        </StackPanel>

                        <Grid>
                            <Grid.Style>
                                <Style TargetType="{x:Type Grid}">
                                    <Setter Property="Visibility" Value="Visible"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Path=Comments.Count}" Value="0">
                                            <Setter Property="Visibility" Value="Collapsed"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Grid.Style>
                            <ItemsControl Margin="10" ItemTemplate="{StaticResource CommentTemplate}"
                                ItemsSource="{Binding Path=Comments}"
                                ItemsPanel="{StaticResource VirtualizedItemsPanelTemplate}" />
                        </Grid>

                        <Border Margin="16,0,-30,10">
                            <Border.Style>
                                <Style TargetType="{x:Type Border}">
                                    <Setter Property="Visibility" Value="Collapsed"/>
                                    <Style.Triggers>
                                        <DataTrigger Binding="{Binding Path=IsChecked, ElementName=CommentButton}" Value="True">
                                            <Setter Property="Visibility" Value="Visible"/>
                                        </DataTrigger>
                                        <DataTrigger Binding="{Binding Converter={StaticResource ShouldShowCommentBoxConverter}}" Value="True">
                                            <Setter Property="Visibility" Value="Visible"/>
                                        </DataTrigger>
                                    </Style.Triggers>
                                </Style>
                            </Border.Style>
                            <StackPanel Orientation="Horizontal" Style="{StaticResource ShareStackPanelStyle}">
                                <NewsFeedSample:CommandTextBox Tag="Add to the conversation"
                                                               Style="{DynamicResource ApplicationBarShareTextBoxStyle}"
                                                               Margin="0"                  
                                                               Width="220"                  
                                                               FontSize="13"                  
                                                               TextWrapping="NoWrap"                  
                                                               SpellCheck.IsEnabled="True"                  
                                                               x:Name="CommentTextBox"                  
                                                               CommitCommand="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.AddCommentCommand}}">
                                    <NewsFeedSample:CommandTextBox.CommitCommandParameter>
                                        <MultiBinding Converter="{StaticResource MultiAggregator}">
                                            <Binding />
                                            <Binding ElementName="CommentTextBox" Path="Text" />
                                        </MultiBinding>
                                    </NewsFeedSample:CommandTextBox.CommitCommandParameter>
                                </NewsFeedSample:CommandTextBox>

                                <Button Content="Share" 
                                        Command="{Binding Source={x:Static NewsFeedSample:FacebookNewsFeedControl.AddCommentCommand}}"                      
                                        FontSize="13.333"                      
                                        Margin="10,0,0,0">
                                    <Button.Style>
                                        <Style TargetType="{x:Type Button}" BasedOn="{StaticResource ShareButtonLightStyle}">
                                            <Setter Property="IsEnabled" Value="True" />
                                            <Style.Triggers>
                                                <DataTrigger Binding="{Binding Path=Text, ElementName=CommentTextBox}"
                                                     Value="">
                                                    <Setter Property="IsEnabled" Value="False" />
                                                </DataTrigger>
                                            </Style.Triggers>
                                        </Style>
                                    </Button.Style>
                                    <Button.CommandParameter>
                                        <MultiBinding Converter="{StaticResource MultiAggregator}">
                                            <Binding />
                                            <Binding ElementName="CommentTextBox" Path="Text" />
                                        </MultiBinding>
                                    </Button.CommandParameter>
                                </Button>
                            </StackPanel>
                        </Border>

                    </StackPanel>
                </Grid>

                <Grid IsHitTestVisible="False" >
                    <Rectangle RadiusX="5" RadiusY="5">
                        <Rectangle.Fill>
                            <RadialGradientBrush ColorInterpolationMode="ScRgbLinearInterpolation" Center="1.095, 1.16" GradientOrigin="1.095, 1.16">
                                <GradientStop Color="#00000000" Offset="1"/>
                                <GradientStop Color="#33FFFFFF" Offset="0.388"/>
                            </RadialGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle RadiusX="5" RadiusY="5">
                        <Rectangle.Fill>
                            <RadialGradientBrush ColorInterpolationMode="ScRgbLinearInterpolation" Center="-.095, 1.16" GradientOrigin="-.095, 1.16">
                                <GradientStop Color="#00000000" Offset="1"/>
                                <GradientStop Color="#4CFFFFFF" Offset="0.388"/>
                            </RadialGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                    <Rectangle RadiusX="5" RadiusY="5">
                        <Rectangle.Stroke>
                            <RadialGradientBrush ColorInterpolationMode="ScRgbLinearInterpolation" RadiusX="0.707" RadiusY="0.707">
                                <GradientStop Color="#00000000" Offset="0.733"/>
                                <GradientStop Color="#FFFFFFFF" Offset="1"/>
                                <GradientStop Color="#FFFFFFFF"/>
                                <GradientStop Color="#15232323" Offset="0.293"/>
                            </RadialGradientBrush>
                        </Rectangle.Stroke>
                        <Rectangle.Fill>
                            <RadialGradientBrush ColorInterpolationMode="ScRgbLinearInterpolation" RadiusX=".7" RadiusY="0.25"  Center="0.46, 0.026" GradientOrigin="0.448, -0">
                                <GradientStop Color="#00000000" Offset="1"/>
                                <GradientStop Color="#22FFFFFF" Offset="0.4"/>
                            </RadialGradientBrush>
                        </Rectangle.Fill>
                    </Rectangle>
                </Grid>

            </Grid>
            <DataTemplate.Triggers>
                <DataTrigger Binding="{Binding Path=HasLiked}" Value="True">
                    <Setter TargetName="RemoveLikeButton"
                        Property="Visibility" Value="Visible" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=IsChecked, ElementName=CommentButton}"
                         Value="True">
                    <Setter TargetName="CommentTextBox"
                        Property="FocusManager.FocusedElement"
                        Value="{Binding ElementName=CommentTextBox}" />
                </DataTrigger>
                <DataTrigger Binding="{Binding Path=Target}" Value="{x:Null}">
                    <Setter TargetName="TargetBlock" Property="Visibility" Value="Collapsed" />
                </DataTrigger>
                <!--<DataTrigger Binding="{Binding Actor.OnlinePresence}" Value="Active">
                    <Setter TargetName="ActivityBorder" Property="BorderBrush">
                        <Setter.Value>
                            <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                                <GradientStop Color="Transparent" Offset="0.0"/>
                                <GradientStop Color="Lime" Offset="1.0"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>
                <DataTrigger Binding="{Binding Actor.OnlinePresence}" Value="Idle">
                    <Setter TargetName="ActivityBorder" Property="BorderBrush">
                        <Setter.Value>
                            <LinearGradientBrush StartPoint="0.5,0.0" EndPoint="0.5,1.0">
                                <GradientStop Color="Transparent" Offset="0.0"/>
                                <GradientStop Color="Orange" Offset="1.0"/>
                            </LinearGradientBrush>
                        </Setter.Value>
                    </Setter>
                </DataTrigger>-->
                <DataTrigger Binding="{Binding Path=Attachment.Caption}" Value="{x:Null}">
                    <Setter TargetName="AttachmentContentPresenter" Property="Visibility" Value="Collapsed"/>
                </DataTrigger>
            </DataTemplate.Triggers>
        </DataTemplate>

        <Style x:Key="{x:Type NewsFeedSample:FacebookNewsFeedControl}" TargetType="{x:Type NewsFeedSample:FacebookNewsFeedControl}">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type NewsFeedSample:FacebookNewsFeedControl}">
                        <ScrollViewer Background="{StaticResource Background_ChromeDefault}">
                            <ItemsControl ItemsSource="{TemplateBinding ActivityPosts}" 
                                      ItemTemplate="{StaticResource NewsFeedItemTemplate}"
                                      VirtualizingStackPanel.IsVirtualizing="True"
                                      VirtualizingStackPanel.VirtualizationMode="Recycling"/>
                        </ScrollViewer>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>

    </Window.Resources>
    <Grid>
        <NewsFeedSample:FacebookNewsFeedControl ActivityPosts="{Binding Source={x:Static NewsFeedSample:ServiceProvider.NewsFeed}}"/>
    </Grid>
</Window>
